// Methods related to links
import { Meteor } from 'meteor/meteor';
import { Arrangements } from './arrangements.js';

Meteor.methods({
  'arrangements.insert'(userId, areaId,onTime, offTime, dayOff, teamId) {

    Meteor.users.update(userId, {
      $set: {
        isArranged: true
      }
    });

    return Arrangements.insert({
      userId,
      areaId,
      onTime,
      offTime,
      dayOff,
      teamId,
      createdAt: new Date(),
    });
  },
  
});
